<template>
  <div class="demo-input-size">
    <p class="p1">
      <span class="sp1">精确查找</span>
      <el-form :model="form" ref="form">
        <el-form-item prop="input1">
          <el-input
            v-model="form.input1"
            class="w-50 m-2"
            size="large"
            placeholder="查询内容"
            :suffix-icon="Search"
            autofocus
          />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="cheked">查询</el-button>
          <el-button type="primary" plain @click="reset">重置</el-button>
        </el-form-item>
      </el-form>
    </p>
    <hr />
  </div>
</template>

<script>
// eslint-disable-next-line no-unused-vars
import { Search } from '@element-plus/icons-vue'
import { checkUser } from '../api/user'
export default {
  data () {
    return {
      form: {
        input1: ''
      }
    }
  },
  methods: {
    cheked (enable) {
      // 行内修改商品选中状态
      checkUser({
        enable
      }).then((res) => {
        if (res.data.code === 200) {
          this.$message({
            type: 'success',
            message: res.data.msg,
            duration: 2000,
            onClose: () => {}
          })
        }
      })
    },
    reset () {
      this.$refs.form.resetFields()
    }
  }
}
</script>

<style lang="scss" scoped>
.demo-input-size {
  margin-bottom: 20px;
  .p1 {
    display: flex;
    background-color: #fff;
    padding: 35px;
    .el-input {
      border-radius: 20px;
    }
    .sp1 {
      margin-right: 35px;
      display: block;
      width: 100px;
      height: 20px;
      margin-left: 50px;
      font-size: 20px;
      font-weight: 900;
    }
  }
}
</style>
